//package com.wang.rabbitmq.springboot;
//
//import com.rabbitmq.client.Channel;
//import com.rabbitmq.client.Connection;
//import com.rabbitmq.client.ConnectionFactory;
//import org.springframework.amqp.rabbit.annotation.Exchange;
//import org.springframework.amqp.rabbit.annotation.Queue;
//import org.springframework.amqp.rabbit.annotation.QueueBinding;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//import java.nio.charset.StandardCharsets;
//import java.util.concurrent.TimeoutException;
//
///**
// * @author: wang
// * @date: 2021/8/4 18:33
// * @description:轮询 polling
// */
//@Component
//public class WorkReceive {
//
//    /*@RabbitListener(bindings = {
//            @QueueBinding(
//                    exchange = @Exchange(name = "defaultExchange",durable = "false"),
//                    value = @Queue(name = "q1", durable = "false"),
//                    key = "q1-key"
//            )
//    })*/
//
//    @RabbitListener(queuesToDeclare = @Queue("q1-key"))
//    public void getWorkPolling1(String message) {
//        System.out.println("1  "+message);
//    }
//
//    @RabbitListener(queuesToDeclare = @Queue("q1-key"))
//    public void getWorkPolling2(String message) {
//        System.out.println("2  "+message);
//    }
//
//}
